package com.siwei.mes.mapper.laboratory;

import com.siwei.mes.common.dataSource.DataSource;
import com.siwei.mes.common.dataSource.DataSourceNames;
import com.siwei.mes.entity.laboratory.SampleUCShuiNi;
import com.siwei.mes.entity.laboratory.concrete.SampleUcHnt;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


public interface UploadLaboratoryMapper {

    //查询最大水泥样品id
    @DataSource(DataSourceNames.LABORATORY)
    public SampleUCShuiNi findCementMaxSampleId();

    //查询最大粉煤灰样品id
    @DataSource(DataSourceNames.LABORATORY)
    public SampleUCShuiNi findFMHMaxSampleId();

    //查询最大混凝土样品id
    @DataSource(DataSourceNames.LABORATORY)
    public Map<String, Object>  findHNTMaxSampleId(@Param("value") String value);

    @DataSource(DataSourceNames.LABORATORY)
    public SampleUcHnt findSampleUCHNTBySampleId(@Param("sampleId") String sampleId);

    //查询最大其他原材料样品id
    @DataSource(DataSourceNames.LABORATORY)
    public Map<String, Object>  findDefaultMaxSampleId(@Param("value") String value);

    //查询规格总表
    @DataSource(DataSourceNames.LABORATORY)
    public List<Map<String, Object>>  findItemSampleBySampleID(@Param("sampleIds")List<String> sampleIds);

    //根据试验名称查询原材料试验项目
    @DataSource(DataSourceNames.LABORATORY)
    public Map<String, Object>  findItemItem(@Param("itemName")String itemName);


    //根据itemId + 原材料名称 查找 SampleID 和 项目 ParameterID
    @DataSource(DataSourceNames.LABORATORY)
    public List<Map<String, Object>> findProjectInformationNew(@Param("materialsName")String materialsName, @Param("itemId")String itemID);

    //根据试验项目名称 + SampleID 查找
    @DataSource(DataSourceNames.LABORATORY)
    public Map<String, Object> findItemParameter(@Param("syxmmz")String syxmmz, @Param("sampleId")String sampleId);

    //根据规格名称 查询规格
    @DataSource(DataSourceNames.LABORATORY)
    public Map<String, Object> findItemGrade(@Param("sampleID")String sampleID, @Param("materialsSpecs")String materialsSpecs);

    //根据规格id集合查询规格
    @DataSource(DataSourceNames.LABORATORY)
    public List<Map<String, Object>> findItemGradeByGradeId(@Param("gradeIds")List<String> gradeIds);

    //根据规格名称集合查询规格
    @DataSource(DataSourceNames.LABORATORY)
    public List<Map<String, Object>> findItemGradeByGradeName(@Param("gradeNames")List<String> gradeNames,@Param("sampleNames")List<String> sampleNames);

    //查询规格名称 规格2
    @DataSource(DataSourceNames.LABORATORY)
    public Map<String, Object> findItemSpec(@Param("sampleID")String sampleID, @Param("materialsSpecs")String materialsSpecs);

    //根据规格id集合查询规格2
    @DataSource(DataSourceNames.LABORATORY)
    public List<Map<String, Object>> findItemSpecBySpecId(@Param("specIds")List<String> specIds);

    //根据规格名称集合查询规格2
    @DataSource(DataSourceNames.LABORATORY)
    public List<Map<String, Object>> findItemSpecBySpecName(@Param("specNames")List<String> specNames,@Param("sampleNames")List<String> sampleNames);

    @DataSource(DataSourceNames.LABORATORY)
    public List<Map<String, Object>> findItemGradeBySpecName(@Param("specNames")List<String> specNames,@Param("sampleNames")List<String> sampleNames);

    //查询粉煤灰的规格信息
    @DataSource(DataSourceNames.LABORATORY)
    public Map<String, Object> findItemGradeAndItemSpec(@Param("sampleID")String sampleID, @Param("materialsSpecs")String materialsSpecs);

    @DataSource(DataSourceNames.LABORATORY)
    String findItemGradeBySampleID(@Param("sampleID")String sampleID);
}
